package com.example.springvalidationdemo.domain;

import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
public class ClassInfo {
    @NotBlank(message = "班主任姓名不能为空")
    private String teacher;
    @NotNull(message = "教师不能为空")
    private Integer classroom;
    @NotNull(message = "年级不能为空")
    @Min(value = 1, message = "年级只能是 1-6")
    @Max(value = 6, message = "年级只能是 1-6")
    private Integer grade;
}